const { SERVER_HTTP } = require('../config')
module.exports = {
  /*
   ** Headers of the page
   */
  head: {
    title: 'starter',
    meta: [
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1' },
      { hid: 'description', name: 'description', content: 'Nuxt.js project' }
    ],
    link: [
      { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
    ]
  },

  /* Global CSS */
  css: [
    '~assets/css/bootstrap-grid.min.css',
    'mdi/css/materialdesignicons.min.css',
    '~assets/stylus/main.styl'
  ],

  /*
   ** Customize the progress-bar color
   */
  loading: { color: '#3B8070' },

  router: {
    middleware: [
      'i18n',
      'visit',
      // 'clearIOSBounce',
    ]
  },
  /*
   ** Build configuration
   */
  build: {
    /*
     ** Run ESLINT on save
     */
    vendor: ['axios'], // 不用担心它会被重复打包
    extend (config, ctx) {
      if (ctx.isClient) {
        config.module.rules.push({
          enforce: 'pre',
          test: /\.(js|vue)$/,
          loader: 'eslint-loader',
          exclude: /(node_modules)/
        })
      }
    }
  },

  plugins: [
    '~/plugins/i18n.js',
    '~/plugins/uagent.js',
    '~/plugins/directives.js',
    { src: '~/plugins/dialog.js', ssr: false }
  ]
}
